(function (factory) {
    if (typeof define === 'function' && define.amd) {
        define(['jquery'], factory);
    } else {
        factory(jQuery);
    }
}(function ($) {
    var fns;

    fns = {

        init: function () {

            $("#slides").studioSlides({
                play: {
                    active: true,
                    effect: "slide",
                    interval: 1000000,
                    auto: false,
                    swap: true,
                    pauseOnHover: true
                },
                navigation: {active: false}
            });

            $('.promo').each(function (index) {
                var that = $(this),
                    _data = that.data('bg');
                that.css({
                    'backgroundImage': 'url('+ _data +')'
                });
            });

        }

    };

    $(fns.init());
}));
